package org.tianyun.cloud.dashboard.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.tianyun.cloud.common.dto.PageRequest;
import org.tianyun.cloud.common.dto.PageResult;
import org.tianyun.cloud.mybatis.plugins.PageHelper;
import org.tianyun.cloud.dashboard.mapper.MasterDatabaseTestMapper;
import org.tianyun.cloud.dashboard.service.MasterDatabaseTestService;
import org.tianyun.cloud.utils.PageBuilder;

import java.util.List;
import java.util.Map;

@Service
public class MasterDatabaseTestServiceImpl implements MasterDatabaseTestService {

    @Autowired
    private MasterDatabaseTestMapper masterDatabaseTestMapper;

    @Override
    public PageResult<Map<String, Object>> list(PageRequest request) {
        PageBuilder<Map<String, Object>> pb = PageHelper.startPage(request);
        List<Map<String, Object>> data = masterDatabaseTestMapper.list();
        pb.setResult(data);
        return pb.build();
    }

    @Override
    public String get() {
        return masterDatabaseTestMapper.get();
    }

    @Override
    public int update() {
        return masterDatabaseTestMapper.update();
    }

    /*
     * @see org.tianyun.cloud.sample.service.MasterDatabaseTestService#getById(java.lang.Long)
     */
    @Override
    public String getById(Long id) {
        return masterDatabaseTestMapper.getById(id);
    }

    /*
     * @see org.tianyun.cloud.sample.service.MasterDatabaseTestService#getByFirstAndSecond(java.lang.Long, java.lang.Long)
     */
    @Override
    public String getByFirstAndSecond(Long first, Long second) {
        return masterDatabaseTestMapper.getByFirstAndSecond(first, second);
    }

    /*
     * @see org.tianyun.cloud.sample.service.MasterDatabaseTestService#getByList(java.util.List)
     */
    @Override
    public String getByList(List<String> list) {
        return masterDatabaseTestMapper.getByList(list);
    }

    /*
     * @see org.tianyun.cloud.sample.service.MasterDatabaseTestService#getByList(java.util.Map)
     */
    @Override
    public String getByMap(Map<String, String> map) {
        return masterDatabaseTestMapper.getByMap(map);
    }

}
